<template>
  <div>
    <h3>我是孙组件</h3>
    <button type="button" @click="childClose">调用混入的方法</button>
  </div>
</template>

<script>
import {mixin} from './../utils/minx'
export default {
  mixins: [mixin],
  inject: ['parent'],
  mounted () {
    console.log('我是孙组件', this.$attrs)
    console.log(this.parent)
  },
  methods: {
    childClose () {
      // close在本组件中没有定义,其实就是使用了minx里面的
      this.close()
    }
  }
}
</script>

<style scoped>
</style>
